﻿@model TCM.Course

@{
    ViewBag.Title = "Create";
}

<table style="width: 99.9%">
    <tr>
        <td class="IndexBack">
            @Html.ActionLink(" ", "Index")</td>
        <td style="text-align: right">
            <span class="FormTitle">@Html.DisplayFor(model => model.Name)</span></td>
    </tr>
</table>
<br />


@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <div class="toolbar">
        <input type="submit" value="Create" class="profile_btn_sep default" />
    </div>
    
    <div class="NavSubMenu">
        <span class="SubMenu_Title">Course...</span>
        <div class="SubMneu">
            <a href="#" id="Information" onclick="changeMenu(this.id)" class="SubMenuActive">
                <span class="NavSubMenu_Title">Information</span>
                <span class="NavSubMenu_Body">General Information Course</span>
            </a>
        </div>
    </div>
    <div class="ContentSubMenu">
        <div id="tabInformation" class="SubMenuContent active">
            <fieldset>
                <span class="SubMenu_Title">Information</span>
                <legend></legend>
                <ol>                    
                    
                      <li class="editor-label">
                        @Html.LabelFor(model => model.SubjectID)

                        @Html.DropDownListFor(model => model.SubjectID, (SelectList)ViewBag.SelectedListSubjects, string.Empty)
                    </li>
                    <li class="editor-label">
                        @Html.LabelFor(model => model.LevelID)

                        @Html.DropDownListFor(model => model.LevelID, (SelectList)ViewBag.SelectListLevels, string.Empty)
                    </li>
                   

                    <li class="editor-label">
                        @Html.LabelFor(model => model.Capacity)

                        @Html.EditorFor(model => model.Capacity)
                        @Html.ValidationMessageFor(model => model.Capacity)
                    </li>


                    <li class="editor-label">
                        @Html.LabelFor(model => model.InstructorID)

                        @Html.DropDownListFor(x => x.InstructorID, (SelectList)ViewBag.SelectListInstructors, string.Empty)
                        @Html.ValidationMessageFor(model => model.InstructorID)
                    </li>


                  

                    <li class="editor-label">
                        @Html.LabelFor(model => model.StartDate)

                        @Html.TextBoxFor(model => model.StartDate, new { @class = "datepicker" })
                        @Html.ValidationMessageFor(model => model.StartDate)
                    </li>

                    <li class="editor-label">
                        @Html.LabelFor(model => model.EndDate)

                        @Html.TextBoxFor(model => model.EndDate, new { @class = "datepicker" })
                        @Html.ValidationMessageFor(model => model.EndDate)
                    </li>
                    <li class="editor-label">
                        @Html.LabelFor(model => model.RoomID)

                        @Html.DropDownListFor(x => x.RoomID, (SelectList)ViewBag.SelectListRooms, string.Empty)
                        @Html.ValidationMessageFor(model => model.RoomID)
                    </li>
                   

                  

                    <li class="editor-label OneColumn">
                        @Html.LabelFor(model => model.Notes)

                        @Html.TextAreaFor(model => model.Notes)
                        @Html.ValidationMessageFor(model => model.Notes)
                    </li>
                </ol>
            </fieldset>
        </div>
    </div>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script type="text/javascript">

    //$('.datepicker').datepicker({
    //    showOn: "button",
    //    buttonImage: "/content/themes/base/images/calendar.png",
    //    buttonImageOnly: true
    //});


</script>


<script lang="javascript" type="text/javascript">
    //$(document).ready(function () {

    //    $("#SubjectID").change(function () {
    //        $.get('/course/RelatedSelectListSubject/' + $(this).val(), function (response)
    //        {    
    //            var SubjectLevels = JSON.parse(response); //$.evalJSON(response);
    //            var ddlSelectSubjectLevel = $("#SUBJECTLEVELID");

    //            // clear all previous options 
    //            $("#SUBJECTLEVELID > option").remove();

    //            //empty option
    //            ddlSelectSubjectLevel.append('<option value=""/>');

    //            //add Subject Level to dropdown list subjectlevel
    //            for (i = 0; i < SubjectLevels.length; i++) {
    //                ddlSelectSubjectLevel
    //                    .append($("<option />")
    //                    .val(SubjectLevels[i].Value).text(SubjectLevels[i].Text));
    //            }
    //        });
    //    });

    //});
</script>
